package com.zycfc.zsf.boot.exception.config;

import org.springframework.boot.context.properties.*;
import com.zycfc.zsf.boot.exception.type.*;

@ConfigurationProperties(prefix = "zsf.boot.exception")
public class ExceptionProperties
{
    public static final String PREFIX = "zsf.boot.exception";
    private boolean enabled;
    private String errorMessageName;
    private String codeName;
    private SendErrorType sendErrorType;
    private String errorPageUrl;
    private String charSet;
    private boolean showErrorFieldName;
    private boolean returnUnkownExceptionMessage;
    private String unkownExceptionMessage;
    
    public ExceptionProperties() {
        this.enabled = true;
        this.errorMessageName = "errMsg";
        this.codeName = "errCode";
        this.sendErrorType = SendErrorType.FORWARD;
        this.charSet = "UTF-8";
        this.showErrorFieldName = false;
        this.returnUnkownExceptionMessage = true;
        this.unkownExceptionMessage = null;
    }
    
    public boolean isEnabled() {
        return this.enabled;
    }
    
    public String getErrorMessageName() {
        return this.errorMessageName;
    }
    
    public String getCodeName() {
        return this.codeName;
    }
    
    public SendErrorType getSendErrorType() {
        return this.sendErrorType;
    }
    
    public String getErrorPageUrl() {
        return this.errorPageUrl;
    }
    
    public String getCharSet() {
        return this.charSet;
    }
    
    public boolean isShowErrorFieldName() {
        return this.showErrorFieldName;
    }
    
    public boolean isReturnUnkownExceptionMessage() {
        return this.returnUnkownExceptionMessage;
    }
    
    public String getUnkownExceptionMessage() {
        return this.unkownExceptionMessage;
    }
    
    public void setEnabled(final boolean enabled) {
        this.enabled = enabled;
    }
    
    public void setErrorMessageName(final String errorMessageName) {
        this.errorMessageName = errorMessageName;
    }
    
    public void setCodeName(final String codeName) {
        this.codeName = codeName;
    }
    
    public void setSendErrorType(final SendErrorType sendErrorType) {
        this.sendErrorType = sendErrorType;
    }
    
    public void setErrorPageUrl(final String errorPageUrl) {
        this.errorPageUrl = errorPageUrl;
    }
    
    public void setCharSet(final String charSet) {
        this.charSet = charSet;
    }
    
    public void setShowErrorFieldName(final boolean showErrorFieldName) {
        this.showErrorFieldName = showErrorFieldName;
    }
    
    public void setReturnUnkownExceptionMessage(final boolean returnUnkownExceptionMessage) {
        this.returnUnkownExceptionMessage = returnUnkownExceptionMessage;
    }
    
    public void setUnkownExceptionMessage(final String unkownExceptionMessage) {
        this.unkownExceptionMessage = unkownExceptionMessage;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof ExceptionProperties)) {
            return false;
        }
        final ExceptionProperties other = (ExceptionProperties)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (this.isEnabled() != other.isEnabled()) {
            return false;
        }
        final Object this$errorMessageName = this.getErrorMessageName();
        final Object other$errorMessageName = other.getErrorMessageName();
        Label_0078: {
            if (this$errorMessageName == null) {
                if (other$errorMessageName == null) {
                    break Label_0078;
                }
            }
            else if (this$errorMessageName.equals(other$errorMessageName)) {
                break Label_0078;
            }
            return false;
        }
        final Object this$codeName = this.getCodeName();
        final Object other$codeName = other.getCodeName();
        Label_0115: {
            if (this$codeName == null) {
                if (other$codeName == null) {
                    break Label_0115;
                }
            }
            else if (this$codeName.equals(other$codeName)) {
                break Label_0115;
            }
            return false;
        }
        final Object this$sendErrorType = this.getSendErrorType();
        final Object other$sendErrorType = other.getSendErrorType();
        Label_0152: {
            if (this$sendErrorType == null) {
                if (other$sendErrorType == null) {
                    break Label_0152;
                }
            }
            else if (this$sendErrorType.equals(other$sendErrorType)) {
                break Label_0152;
            }
            return false;
        }
        final Object this$errorPageUrl = this.getErrorPageUrl();
        final Object other$errorPageUrl = other.getErrorPageUrl();
        Label_0189: {
            if (this$errorPageUrl == null) {
                if (other$errorPageUrl == null) {
                    break Label_0189;
                }
            }
            else if (this$errorPageUrl.equals(other$errorPageUrl)) {
                break Label_0189;
            }
            return false;
        }
        final Object this$charSet = this.getCharSet();
        final Object other$charSet = other.getCharSet();
        Label_0226: {
            if (this$charSet == null) {
                if (other$charSet == null) {
                    break Label_0226;
                }
            }
            else if (this$charSet.equals(other$charSet)) {
                break Label_0226;
            }
            return false;
        }
        if (this.isShowErrorFieldName() != other.isShowErrorFieldName()) {
            return false;
        }
        if (this.isReturnUnkownExceptionMessage() != other.isReturnUnkownExceptionMessage()) {
            return false;
        }
        final Object this$unkownExceptionMessage = this.getUnkownExceptionMessage();
        final Object other$unkownExceptionMessage = other.getUnkownExceptionMessage();
        if (this$unkownExceptionMessage == null) {
            if (other$unkownExceptionMessage == null) {
                return true;
            }
        }
        else if (this$unkownExceptionMessage.equals(other$unkownExceptionMessage)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof ExceptionProperties;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * 59 + (this.isEnabled() ? 79 : 97);
        final Object $errorMessageName = this.getErrorMessageName();
        result = result * 59 + (($errorMessageName == null) ? 43 : $errorMessageName.hashCode());
        final Object $codeName = this.getCodeName();
        result = result * 59 + (($codeName == null) ? 43 : $codeName.hashCode());
        final Object $sendErrorType = this.getSendErrorType();
        result = result * 59 + (($sendErrorType == null) ? 43 : $sendErrorType.hashCode());
        final Object $errorPageUrl = this.getErrorPageUrl();
        result = result * 59 + (($errorPageUrl == null) ? 43 : $errorPageUrl.hashCode());
        final Object $charSet = this.getCharSet();
        result = result * 59 + (($charSet == null) ? 43 : $charSet.hashCode());
        result = result * 59 + (this.isShowErrorFieldName() ? 79 : 97);
        result = result * 59 + (this.isReturnUnkownExceptionMessage() ? 79 : 97);
        final Object $unkownExceptionMessage = this.getUnkownExceptionMessage();
        result = result * 59 + (($unkownExceptionMessage == null) ? 43 : $unkownExceptionMessage.hashCode());
        return result;
    }
    
    @Override
    public String toString() {
        return "ExceptionProperties(enabled=" + this.isEnabled() + ", errorMessageName=" + this.getErrorMessageName() + ", codeName=" + this.getCodeName() + ", sendErrorType=" + this.getSendErrorType() + ", errorPageUrl=" + this.getErrorPageUrl() + ", charSet=" + this.getCharSet() + ", showErrorFieldName=" + this.isShowErrorFieldName() + ", returnUnkownExceptionMessage=" + this.isReturnUnkownExceptionMessage() + ", unkownExceptionMessage=" + this.getUnkownExceptionMessage() + ")";
    }
}
